using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework;

namespace Xfinity.Rendering
{
    public class UberShader : Effect
    {
        public UberShader(GraphicsDevice graphicsDevice, ContentManager content)
            : base(graphicsDevice, content.Load<Effect>(@"Content\Effects\StandardFX"))
        {
            diffuseTex = Parameters.GetParameterBySemantic("DiffuseMap");
            specularTex = Parameters.GetParameterBySemantic("SpecularMap");
            ambientOcclusionMap = Parameters.GetParameterBySemantic("AmbientOcclusionMap");
            world = Parameters.GetParameterBySemantic("WORLD");
            view = Parameters.GetParameterBySemantic("VIEW");
            projection = Parameters.GetParameterBySemantic("PROJECTION");
            ambientColour = Parameters.GetParameterBySemantic("Ambient");
        }
        
        #region DiffuseTexture
        EffectParameter diffuseTex;
        /// <summary>
        /// DiffuseTexture.
        /// </summary>
        public Texture2D DiffuseTexture
        {
            [System.Diagnostics.DebuggerStepThroughAttribute]
            get { return diffuseTex.GetValueTexture2D(); }
            [System.Diagnostics.DebuggerStepThroughAttribute]
            set { diffuseTex.SetValue(value); }
        }
        #endregion
        #region SpecularTexture
        private EffectParameter specularTex;

        /// <summary>
        /// SpecularTexture.
        /// </summary>
        public Texture2D SpecularTexture
        {
            [System.Diagnostics.DebuggerStepThroughAttribute]
            get { return specularTex.GetValueTexture2D(); }
            [System.Diagnostics.DebuggerStepThroughAttribute]
            set { specularTex.SetValue(value); }
        }
        #endregion
        #region AmbientOcclusionMap
        private EffectParameter ambientOcclusionMap;
        public Texture2D AmbientOcclusionMap
        {
            get { return ambientOcclusionMap.GetValueTexture2D(); }
            set { ambientOcclusionMap.SetValue(value); }
        }
        #endregion
        #region World
        private EffectParameter world;
        public Matrix World
        {
            get { return world.GetValueMatrix(); }
            set { world.SetValue(value); }
        }
        #endregion
        #region View
        private EffectParameter view;
        public Matrix View
        {
            get { return view.GetValueMatrix(); }
            set { view.SetValue(value); }
        }
        #endregion
        #region Projection
        private EffectParameter projection;
        public Matrix Projection
        {
            get { return projection.GetValueMatrix(); }
            set { projection.SetValue(value); }
        }
        #endregion
        #region AmbientColour
        private EffectParameter ambientColour;
        public Vector3 AmbientColour
        {
            get { return ambientColour.GetValueVector3(); }
            set { ambientColour.SetValue(value); }
        }
        #endregion
    }
}
